package com.netbao.veh.vomapper;

import com.netbao.veh.model.Vehicle;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface VehicleVoMapper {
    @Select("SELECT * FROM veh_vehicle WHERE eid=#{eId} AND isdelete=FALSE AND isstop=FALSE  AND ischecked=TRUE AND proid IS NULL OR proid=#{proId}")
    List<Vehicle> getProVeh(Long proId, Integer eId);

    @Update("UPDATE veh_vehicle SET proid=#{proId} WHERE id IN(${vehIds})")
    int binDingVeh(Long proId, String vehIds);

    @Update("UPDATE veh_vehicle SET proid=NULL WHERE eid=#{eid} AND isdelete=FALSE AND isstop=FALSE  AND ischecked=TRUE AND proid IS NULL OR proid=#{proid}")
    int clearPro(Long proid, Integer eid);
}
